const mysql = require('mysql')
const db = mysql.createPool({
    host:'127.0.0.1',
    user:'root',
    password:'root1234',
    database:'book_new'
})
// 检测连接是否成功
db.query('select 1' , (err,res)=>{
    if(err) return console.log(err.message)
    console.log('数据库连接成功')
})

module.exports = db